﻿@model QqhrCitizen.Models.TypeDictionary
@using QqhrCitizen.Models;
@{
    ViewBag.Title = "TypeDictionaryEdit";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    List<TypeDictionary> lstFather = ViewBag.LstFatherTypeDictionary as List<TypeDictionary>;
}

<div>
    <div class="result-title">
        <h1 class="head-tietle">类型修改</a></h1>
    </div>
    <div class="result-content">
        @using (Html.BeginForm("TypeDictionaryEdit", "Admin", new { id = Model.ID }, FormMethod.Post, new { id = "frmTypeDictionaryEdit" }))
        {
            @Html.AntiForgerySID()
            <table class="detail-table">
                <tr>
                    <td class="row-title">所属类别</td>
                    <td>
                        <select name="Belonger" id="lsBelonger">
                            <option @(Model.Belonger.ToString() == "新闻" ? "selected" : "")>新闻</option>
                            <option @(Model.Belonger.ToString() == "文件" ? "selected" : "")>文件</option>
                            <option @(Model.Belonger.ToString() == "资源链接" ? "selected" : "")>资源链接</option>
                            <option @(Model.Belonger.ToString() == "电子书" ? "selected" : "")>电子书</option>
                            <option @(Model.Belonger.ToString() == "课程" ? "selected" : "")>课程</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="row-title">
                        内容
                    </td>
                    <td>
                        <input type="text" name="TypeValue" class="textbox" value="@Model.TypeValue" />
                    </td>
                </tr>
                <tr>
                    <td class="row-title">
                        优先级
                    </td>
                    <td>
                        <input type="text" name="PID" class="textbox" value="@Model.PID" />(请填写数据，数字越小排名越靠前)
                    </td>
                </tr>
                <tr>
                    <td class="row-title">
                        是否需要登陆标记
                    </td>
                    <td>
                        <select name="NeedAuthorize" class="textbox">
                            <option value="false" @(Model.NeedAuthorize ? "" : "selected")>否</option>
                            <option value="true" @(Model.NeedAuthorize ? "selected" : "")>是</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="row-title">
                        是否高亮
                    </td>
                    <td>
                        <select name="Top" class="textbox">
                            <option value="false" @(Model.Top ? "" : "selected")>否</option>
                            <option value="true" @(Model.Top ? "selected" : "")>是</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="row-title">
                        上级类型
                    </td>
                    <td>
                        <select name="FatherID" id="lsFatherID" class="textbox">
                            <option value="0">无上级分类</option>
                            @if (lstFather != null)
                            {
                                foreach (var item in lstFather)
                                {
                                    <option value="@item.ID" @(item.ID == Model.FatherID ? "selected" : "")>@item.TypeValue</option>
                                }
                            }
                        </select>
                    </td>
                </tr>
            </table>
            <p><input type="submit" value="保存" class="button blue" /></p>
        }

    </div>
</div>